<template>
	<a-breadcrumb class="container-breadcrumb">
		<a-breadcrumb-item>
			<icon-apps />
		</a-breadcrumb-item>
		<a-breadcrumb-item v-for="item in items" :key="item">
			{{ item }}
		</a-breadcrumb-item>
	</a-breadcrumb>
</template>

<script lang="ts" setup>
import router from '@/router';
import { PropType } from 'vue';

defineProps({
	items: {
		type: Array as PropType<string[]>,
		default() {
			const temps = router.currentRoute.value.matched;
			const arr: string[] = [];
			temps.forEach((item) => {
				arr.push(item.meta.title as string);
			});
			return arr;
		}
	}
});
</script>

<style scoped lang="less">
.container-breadcrumb {
	margin: 16px 0;

	:deep(.arco-breadcrumb-item) {
		color: rgb(var(--gray-6));

		&:last-child {
			color: rgb(var(--gray-8));
		}
	}
}
</style>
